from google.appengine.ext import db


# DATA:
class Summary(db.Model):
    youtubeId = db.StringProperty()
    json = db.TextProperty()

# GET HTML:
def edit(h):
    pass

# GET String:
def get(h):
    summary = Summary.all().filter( "youtubeId = ", (h.di["youtubeId"]) ).get() 
    h.do["output"] = summary.json


# POST:
def save(h):
    summary = Summary.all().filter("youtubeId = ", h.di["youtubeId"]).get()
    if not summary:
        summary = Summary(youtubeId = h.di["youtubeId"])
    summary.json = h.di["json"]
    summary.put()

